{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 准备工作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests,json\n",
    "import pandas as pd\n",
    "from PIL import Image\n",
    "from io import BytesIO\n",
    "he_key = \"7df554c5d3c7c40bc81e2c8dd4eaac57\"  # 到高德官网注册账号申请web服务API类型key\n",
    "import geo"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function geocode in module geo:\n",
      "\n",
      "geocode(key, address, city, batch='false', output='JSON', callback=None)\n",
      "    获取高德API的地理编码\n",
      "    注释：address是指结构化地址\n",
      "    city为指定城市（可填写城市名中文、中文全拼、citycode、adcode，不支持县级市）\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(geo.geocode)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "geocode_adress = \"广东省广州市中山大学南方学院\"\n",
    "geocode_city = \"广东\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.geocode(he_key,geocode_adress,geocode_city)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 步行路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function walking in module geo:\n",
      "\n",
      "walking(key, origin, destination, output='JSON', callback=None)\n",
      "    获取步行路径函数\n",
      "    注释：origin为起始地的坐标，destination为目的地的坐标\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(geo.walking)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "origin_中大南方 = geo.geocode(he_key,geocode_adress,geocode_city)\n",
    "destination_暨南大学_1 = \"广东省广州市暨南大学\"\n",
    "destination_暨南大学 = geo.geocode(he_key,destination_暨南大学_1,\"广东\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instruction</th>\n",
       "      <th>orientation</th>\n",
       "      <th>road</th>\n",
       "      <th>distance</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>action</th>\n",
       "      <th>assistant_action</th>\n",
       "      <th>walk_type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>向东步行101米右转</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>101</td>\n",
       "      <td>81</td>\n",
       "      <td>113.679592,23.632491;113.680586,23.632522</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>向南步行199米向右前方行走</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>199</td>\n",
       "      <td>159</td>\n",
       "      <td>113.680586,23.632522;113.680638,23.63214;113.6...</td>\n",
       "      <td>向右前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>向西步行159米左转</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>159</td>\n",
       "      <td>127</td>\n",
       "      <td>113.680204,23.630838;113.680035,23.630773;113....</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>向南步行237米左转</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>237</td>\n",
       "      <td>190</td>\n",
       "      <td>113.678711,23.63036;113.678711,23.62934;113.67...</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>向南步行498米向右前方行走</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>498</td>\n",
       "      <td>398</td>\n",
       "      <td>113.678273,23.628368;113.678572,23.628338;113....</td>\n",
       "      <td>向右前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>步行16米直行</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>16</td>\n",
       "      <td>13</td>\n",
       "      <td>113.347418,23.13556;113.347578,23.135547</td>\n",
       "      <td>直行</td>\n",
       "      <td>[]</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>沿花园路向东步行220米直行</td>\n",
       "      <td>东</td>\n",
       "      <td>花园路</td>\n",
       "      <td>220</td>\n",
       "      <td>176</td>\n",
       "      <td>113.347578,23.135543;113.348121,23.135534;113....</td>\n",
       "      <td>直行</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>沿真如东路向东南步行311米向左前方行走</td>\n",
       "      <td>东南</td>\n",
       "      <td>真如东路</td>\n",
       "      <td>311</td>\n",
       "      <td>249</td>\n",
       "      <td>113.349705,23.135386;113.349792,23.135382;113....</td>\n",
       "      <td>向左前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>101</th>\n",
       "      <td>沿真如东路向南步行219米右转</td>\n",
       "      <td>南</td>\n",
       "      <td>真如东路</td>\n",
       "      <td>219</td>\n",
       "      <td>175</td>\n",
       "      <td>113.351102,23.133424;113.351215,23.13326;113.3...</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>102</th>\n",
       "      <td>沿明湖南路向西步行35米到达目的地</td>\n",
       "      <td>西</td>\n",
       "      <td>明湖南路</td>\n",
       "      <td>35</td>\n",
       "      <td>28</td>\n",
       "      <td>113.351354,23.13148;113.351016,23.131454</td>\n",
       "      <td>[]</td>\n",
       "      <td>到达目的地</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>103 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              instruction orientation  road distance duration  \\\n",
       "0              向东步行101米右转           东    []      101       81   \n",
       "1          向南步行199米向右前方行走           南    []      199      159   \n",
       "2              向西步行159米左转           西    []      159      127   \n",
       "3              向南步行237米左转           南    []      237      190   \n",
       "4          向南步行498米向右前方行走           南    []      498      398   \n",
       "..                    ...         ...   ...      ...      ...   \n",
       "98                步行16米直行          []    []       16       13   \n",
       "99         沿花园路向东步行220米直行           东   花园路      220      176   \n",
       "100  沿真如东路向东南步行311米向左前方行走          东南  真如东路      311      249   \n",
       "101       沿真如东路向南步行219米右转           南  真如东路      219      175   \n",
       "102     沿明湖南路向西步行35米到达目的地           西  明湖南路       35       28   \n",
       "\n",
       "                                              polyline  action  \\\n",
       "0            113.679592,23.632491;113.680586,23.632522      右转   \n",
       "1    113.680586,23.632522;113.680638,23.63214;113.6...  向右前方行走   \n",
       "2    113.680204,23.630838;113.680035,23.630773;113....      左转   \n",
       "3    113.678711,23.63036;113.678711,23.62934;113.67...      左转   \n",
       "4    113.678273,23.628368;113.678572,23.628338;113....  向右前方行走   \n",
       "..                                                 ...     ...   \n",
       "98            113.347418,23.13556;113.347578,23.135547      直行   \n",
       "99   113.347578,23.135543;113.348121,23.135534;113....      直行   \n",
       "100  113.349705,23.135386;113.349792,23.135382;113....  向左前方行走   \n",
       "101  113.351102,23.133424;113.351215,23.13326;113.3...      右转   \n",
       "102           113.351354,23.13148;113.351016,23.131454      []   \n",
       "\n",
       "    assistant_action walk_type  \n",
       "0                 []         0  \n",
       "1                 []         0  \n",
       "2                 []         0  \n",
       "3                 []         0  \n",
       "4                 []         0  \n",
       "..               ...       ...  \n",
       "98                []        20  \n",
       "99                []         0  \n",
       "100               []         0  \n",
       "101               []         0  \n",
       "102            到达目的地         0  \n",
       "\n",
       "[103 rows x 9 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.walking(he_key,origin_中大南方,destination_暨南大学)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 公交路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function bus in module geo:\n",
      "\n",
      "bus(key, origin, destination, city, cityd, extensions='base', strategy=3, nightflag=0, output='JSON', callback=None)\n",
      "    获取公交路径的函数\n",
      "    注释：origin为起始地的坐标，destination为目的地的坐标,city为出发地城市，cityd为目的地城市\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(geo.bus)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instruction</th>\n",
       "      <th>road</th>\n",
       "      <th>distance</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>action</th>\n",
       "      <th>assistant_action</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>步行57米右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>57</td>\n",
       "      <td>[]</td>\n",
       "      <td>113.679016,23.632349;113.678528,23.632097</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>步行47米向左前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>47</td>\n",
       "      <td>[]</td>\n",
       "      <td>113.678528,23.632092;113.678398,23.632166;113....</td>\n",
       "      <td>向左前方行走</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>步行218米左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>218</td>\n",
       "      <td>[]</td>\n",
       "      <td>113.678101,23.632261;113.677834,23.632261;113....</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>沿博学路步行191米到达中大南方学院</td>\n",
       "      <td>博学路</td>\n",
       "      <td>191</td>\n",
       "      <td>[]</td>\n",
       "      <td>113.676285,23.632969;113.676292,23.632227;113....</td>\n",
       "      <td>[]</td>\n",
       "      <td>到达中大南方学院</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          instruction road distance duration  \\\n",
       "0             步行57米右转   []       57       []   \n",
       "1         步行47米向左前方行走   []       47       []   \n",
       "2            步行218米左转   []      218       []   \n",
       "3  沿博学路步行191米到达中大南方学院  博学路      191       []   \n",
       "\n",
       "                                            polyline  action assistant_action  \n",
       "0          113.679016,23.632349;113.678528,23.632097      右转               []  \n",
       "1  113.678528,23.632092;113.678398,23.632166;113....  向左前方行走               []  \n",
       "2  113.678101,23.632261;113.677834,23.632261;113....      左转               []  \n",
       "3  113.676285,23.632969;113.676292,23.632227;113....      []         到达中大南方学院  "
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 步行前往车站路径\n",
    "pd.json_normalize(geo.bus(he_key,origin_中大南方,destination_暨南大学,'广东','广东')['route']['transits'][0]['segments'][0]['walking']['steps'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>type</th>\n",
       "      <th>distance</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>bustimetag</th>\n",
       "      <th>start_time</th>\n",
       "      <th>end_time</th>\n",
       "      <th>via_num</th>\n",
       "      <th>via_stops</th>\n",
       "      <th>departure_stop.name</th>\n",
       "      <th>departure_stop.id</th>\n",
       "      <th>departure_stop.location</th>\n",
       "      <th>arrival_stop.name</th>\n",
       "      <th>arrival_stop.id</th>\n",
       "      <th>arrival_stop.location</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>从15路(中大南方学院--从化汽车站总站)</td>\n",
       "      <td>900000111141</td>\n",
       "      <td>普通公交线路</td>\n",
       "      <td>19693</td>\n",
       "      <td>3295</td>\n",
       "      <td>113.676613,23.631281;113.676460,23.631588;113....</td>\n",
       "      <td>2</td>\n",
       "      <td>0900</td>\n",
       "      <td>1800</td>\n",
       "      <td>20</td>\n",
       "      <td>[{'name': '大南方学院总站', 'id': '900000111141003', ...</td>\n",
       "      <td>中大南方学院</td>\n",
       "      <td>900000111141002</td>\n",
       "      <td>113.676613,23.631281</td>\n",
       "      <td>从化汽车站总站</td>\n",
       "      <td>900000111141021</td>\n",
       "      <td>113.599414,23.527556</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    name            id    type distance duration  \\\n",
       "0  从15路(中大南方学院--从化汽车站总站)  900000111141  普通公交线路    19693     3295   \n",
       "\n",
       "                                            polyline bustimetag start_time  \\\n",
       "0  113.676613,23.631281;113.676460,23.631588;113....          2       0900   \n",
       "\n",
       "  end_time via_num                                          via_stops  \\\n",
       "0     1800      20  [{'name': '大南方学院总站', 'id': '900000111141003', ...   \n",
       "\n",
       "  departure_stop.name departure_stop.id departure_stop.location  \\\n",
       "0              中大南方学院   900000111141002    113.676613,23.631281   \n",
       "\n",
       "  arrival_stop.name  arrival_stop.id arrival_stop.location  \n",
       "0           从化汽车站总站  900000111141021  113.599414,23.527556  "
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 需要乘坐的公交车信息\n",
    "pd.json_normalize(geo.bus(he_key,origin_中大南方,destination_暨南大学,'广东','广东')['route']['transits'][0]['segments'][0]['bus']['buslines'][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>大南方学院总站</td>\n",
       "      <td>900000111141003</td>\n",
       "      <td>113.671707,23.643766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>卫东</td>\n",
       "      <td>900000111141030</td>\n",
       "      <td>113.671771,23.644323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>交警温泉中队</td>\n",
       "      <td>900000111141029</td>\n",
       "      <td>113.656944,23.630299</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>冲口</td>\n",
       "      <td>900000111141022</td>\n",
       "      <td>113.649731,23.624987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>牛步迳</td>\n",
       "      <td>900000111141006</td>\n",
       "      <td>113.644640,23.621901</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>华辉度假村</td>\n",
       "      <td>900000111141023</td>\n",
       "      <td>113.638325,23.620156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>温泉镇政府</td>\n",
       "      <td>900000111141008</td>\n",
       "      <td>113.632957,23.615774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>云台山站</td>\n",
       "      <td>900000111141024</td>\n",
       "      <td>113.630844,23.610802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>宣星路口</td>\n",
       "      <td>900000111141010</td>\n",
       "      <td>113.628891,23.602587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>新华</td>\n",
       "      <td>900000111141011</td>\n",
       "      <td>113.620674,23.590054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>水底村</td>\n",
       "      <td>900000111141012</td>\n",
       "      <td>113.619401,23.587491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>南洋理工职业学院</td>\n",
       "      <td>900000111141028</td>\n",
       "      <td>113.617578,23.582357</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>江埔社区</td>\n",
       "      <td>900000111141014</td>\n",
       "      <td>113.618210,23.573103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>沙塱村</td>\n",
       "      <td>900000111141015</td>\n",
       "      <td>113.615547,23.557409</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>凤院北</td>\n",
       "      <td>900000111141025</td>\n",
       "      <td>113.612526,23.553211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>凤院路口</td>\n",
       "      <td>900000111141016</td>\n",
       "      <td>113.610443,23.550087</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>江埔村二社</td>\n",
       "      <td>900000111141026</td>\n",
       "      <td>113.608154,23.546612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>江埔村</td>\n",
       "      <td>900000111141018</td>\n",
       "      <td>113.608954,23.540612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>迎福里</td>\n",
       "      <td>900000111141019</td>\n",
       "      <td>113.609214,23.535690</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>城建学院</td>\n",
       "      <td>900000111141020</td>\n",
       "      <td>113.607122,23.530247</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        name               id              location\n",
       "0    大南方学院总站  900000111141003  113.671707,23.643766\n",
       "1         卫东  900000111141030  113.671771,23.644323\n",
       "2     交警温泉中队  900000111141029  113.656944,23.630299\n",
       "3         冲口  900000111141022  113.649731,23.624987\n",
       "4        牛步迳  900000111141006  113.644640,23.621901\n",
       "5      华辉度假村  900000111141023  113.638325,23.620156\n",
       "6      温泉镇政府  900000111141008  113.632957,23.615774\n",
       "7       云台山站  900000111141024  113.630844,23.610802\n",
       "8       宣星路口  900000111141010  113.628891,23.602587\n",
       "9         新华  900000111141011  113.620674,23.590054\n",
       "10       水底村  900000111141012  113.619401,23.587491\n",
       "11  南洋理工职业学院  900000111141028  113.617578,23.582357\n",
       "12      江埔社区  900000111141014  113.618210,23.573103\n",
       "13       沙塱村  900000111141015  113.615547,23.557409\n",
       "14       凤院北  900000111141025  113.612526,23.553211\n",
       "15      凤院路口  900000111141016  113.610443,23.550087\n",
       "16     江埔村二社  900000111141026  113.608154,23.546612\n",
       "17       江埔村  900000111141018  113.608954,23.540612\n",
       "18       迎福里  900000111141019  113.609214,23.535690\n",
       "19      城建学院  900000111141020  113.607122,23.530247"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 公交车途径站点\n",
    "pd.json_normalize(geo.bus(he_key,origin_中大南方,destination_暨南大学,'广东','广东')['route']['transits'][0]['segments'][0]['bus']['buslines'][0]['via_stops'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 驾车路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function driving in module geo:\n",
      "\n",
      "driving(key, origin, destination, province, number, cartype=0, strategy=10, originid=None, destinationid=None, origintype=None, destinationtype=None, waypoints=None, avoidpolygons=None, avoidroad=None, ferry=0, roadaggregation='false', nosteps=0, output='JSON', callback=None, extensions='base')\n",
      "    获取驾车路径函数\n",
      "    注释：origin为起始地的坐标，destination为目的地的坐标\n",
      "    province为车牌省份汉字缩写，number为车牌处省份外的字母与数字\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(geo.driving)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "driving_origin = origin_中大南方\n",
    "driving_destination = destination_暨南大学\n",
    "driving_province = \"粤\"\n",
    "driving_number = \"4778\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instruction</th>\n",
       "      <th>orientation</th>\n",
       "      <th>distance</th>\n",
       "      <th>tolls</th>\n",
       "      <th>toll_distance</th>\n",
       "      <th>toll_road</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>action</th>\n",
       "      <th>assistant_action</th>\n",
       "      <th>road</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>向北行驶122米向左前方行驶</td>\n",
       "      <td>北</td>\n",
       "      <td>122</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>28</td>\n",
       "      <td>113.679596,23.632574;113.679596,23.632856;113....</td>\n",
       "      <td>向左前方行驶</td>\n",
       "      <td>[]</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>沿博学路向北行驶79米向左前方行驶</td>\n",
       "      <td>北</td>\n",
       "      <td>79</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>24</td>\n",
       "      <td>113.679648,23.633689;113.679549,23.633967;113....</td>\n",
       "      <td>向左前方行驶</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>沿博学路向西北行驶118米左转</td>\n",
       "      <td>西北</td>\n",
       "      <td>118</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>29</td>\n",
       "      <td>113.679375,23.634358;113.679249,23.634479;113....</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>沿博学路向西行驶163米右转</td>\n",
       "      <td>西</td>\n",
       "      <td>163</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>35</td>\n",
       "      <td>113.678555,23.635109;113.677856,23.635087;113....</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>沿博学路向西行驶33米右转</td>\n",
       "      <td>西</td>\n",
       "      <td>33</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>11</td>\n",
       "      <td>113.677083,23.634661;113.677027,23.634701;113....</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>沿中山路向西北行驶1.3千米右转</td>\n",
       "      <td>西北</td>\n",
       "      <td>1265</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>197</td>\n",
       "      <td>113.676788,23.634657;113.675265,23.636128;113....</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>沿温泉大道向东北行驶605米左转调头</td>\n",
       "      <td>东北</td>\n",
       "      <td>605</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>79</td>\n",
       "      <td>113.671428,23.644045;113.671636,23.644162;113....</td>\n",
       "      <td>左转调头</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>沿温泉大道向西南行驶916米向右前方行驶进入匝道</td>\n",
       "      <td>西南</td>\n",
       "      <td>916</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>62</td>\n",
       "      <td>113.676367,23.647088;113.675964,23.646745;113....</td>\n",
       "      <td>向右前方行驶</td>\n",
       "      <td>进入匝道</td>\n",
       "      <td>温泉大道</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>沿G45大广高速入口向西南行驶836米减速行驶到达收费站</td>\n",
       "      <td>西南</td>\n",
       "      <td>836</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>89</td>\n",
       "      <td>113.668776,23.642674;113.668546,23.642578;113....</td>\n",
       "      <td>减速行驶</td>\n",
       "      <td>到达收费站</td>\n",
       "      <td>G45大广高速入口</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>沿G45大广高速入口向南行驶49米靠左</td>\n",
       "      <td>南</td>\n",
       "      <td>49</td>\n",
       "      <td>0</td>\n",
       "      <td>49</td>\n",
       "      <td>G45大广高速入口</td>\n",
       "      <td>2</td>\n",
       "      <td>113.666063,23.637999;113.666033,23.637548</td>\n",
       "      <td>靠左</td>\n",
       "      <td>[]</td>\n",
       "      <td>G45大广高速入口</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>沿G45大广高速入口途径G45大广高速向西南行驶1.7千米直行进入隧道</td>\n",
       "      <td>西南</td>\n",
       "      <td>1741</td>\n",
       "      <td>0</td>\n",
       "      <td>1741</td>\n",
       "      <td>G45大广高速入口</td>\n",
       "      <td>83</td>\n",
       "      <td>113.666033,23.637548;113.666046,23.637448;113....</td>\n",
       "      <td>直行</td>\n",
       "      <td>进入隧道</td>\n",
       "      <td>G45大广高速入口</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>沿牛步迳隧道途径温泉流溪河特大桥、G45大广高速向西南行驶8.6千米直行进入隧道</td>\n",
       "      <td>西南</td>\n",
       "      <td>8576</td>\n",
       "      <td>0</td>\n",
       "      <td>8576</td>\n",
       "      <td>牛步迳隧道</td>\n",
       "      <td>328</td>\n",
       "      <td>113.656667,23.6251;113.656471,23.624657;113.65...</td>\n",
       "      <td>直行</td>\n",
       "      <td>进入隧道</td>\n",
       "      <td>牛步迳隧道</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>沿明珠隧道途径G45大广高速向西南行驶7.8千米直行进入隧道</td>\n",
       "      <td>西南</td>\n",
       "      <td>7814</td>\n",
       "      <td>0</td>\n",
       "      <td>7814</td>\n",
       "      <td>明珠隧道</td>\n",
       "      <td>297</td>\n",
       "      <td>113.589965,23.583819;113.589345,23.583633;113....</td>\n",
       "      <td>直行</td>\n",
       "      <td>进入隧道</td>\n",
       "      <td>明珠隧道</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>沿耙齿影隧道途径G45大广高速、牛心岭大桥向西南行驶15.6千米向右前方行驶进入匝道</td>\n",
       "      <td>西南</td>\n",
       "      <td>15624</td>\n",
       "      <td>0</td>\n",
       "      <td>15624</td>\n",
       "      <td>耙齿影隧道</td>\n",
       "      <td>646</td>\n",
       "      <td>113.541775,23.5374;113.541345,23.536298;113.54...</td>\n",
       "      <td>向右前方行驶</td>\n",
       "      <td>进入匝道</td>\n",
       "      <td>耙齿影隧道</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>沿G45大广高速出口向西行驶485米靠左</td>\n",
       "      <td>西</td>\n",
       "      <td>485</td>\n",
       "      <td>0</td>\n",
       "      <td>485</td>\n",
       "      <td>G45大广高速出口</td>\n",
       "      <td>18</td>\n",
       "      <td>113.438164,23.444544;113.438056,23.444631;113....</td>\n",
       "      <td>靠左</td>\n",
       "      <td>[]</td>\n",
       "      <td>G45大广高速出口</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>沿机场北立交向西行驶535米向右前方行驶</td>\n",
       "      <td>西</td>\n",
       "      <td>535</td>\n",
       "      <td>0</td>\n",
       "      <td>535</td>\n",
       "      <td>机场北立交</td>\n",
       "      <td>34</td>\n",
       "      <td>113.433542,23.445443;113.431901,23.445846;113....</td>\n",
       "      <td>向右前方行驶</td>\n",
       "      <td>[]</td>\n",
       "      <td>机场北立交</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>沿机场北立交途径G4京港澳高速向南行驶20.6千米靠左沿主路行驶</td>\n",
       "      <td>南</td>\n",
       "      <td>20589</td>\n",
       "      <td>0</td>\n",
       "      <td>20589</td>\n",
       "      <td>机场北立交</td>\n",
       "      <td>848</td>\n",
       "      <td>113.42852,23.446866;113.428181,23.447053;113.4...</td>\n",
       "      <td>靠左</td>\n",
       "      <td>沿主路行驶</td>\n",
       "      <td>机场北立交</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>沿S4华南快速途径梅窿2号大桥、石湖中桥、梅窿1号大桥、长坤1号桥、金垄大桥向南行驶6.1千...</td>\n",
       "      <td>南</td>\n",
       "      <td>6053</td>\n",
       "      <td>0</td>\n",
       "      <td>6053</td>\n",
       "      <td>S4华南快速</td>\n",
       "      <td>294</td>\n",
       "      <td>113.368116,23.282135;113.367986,23.280026;113....</td>\n",
       "      <td>直行</td>\n",
       "      <td>进入隧道</td>\n",
       "      <td>S4华南快速</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>沿石门堂山隧道途径S4华南快速向南行驶2.5千米靠左沿主路行驶</td>\n",
       "      <td>南</td>\n",
       "      <td>2504</td>\n",
       "      <td>0</td>\n",
       "      <td>2504</td>\n",
       "      <td>石门堂山隧道</td>\n",
       "      <td>121</td>\n",
       "      <td>113.358932,23.231901;113.359084,23.231458;113....</td>\n",
       "      <td>靠左</td>\n",
       "      <td>沿主路行驶</td>\n",
       "      <td>石门堂山隧道</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>沿S4华南快速向南行驶10.1千米向右前方行驶进入匝道</td>\n",
       "      <td>南</td>\n",
       "      <td>10105</td>\n",
       "      <td>0</td>\n",
       "      <td>10105</td>\n",
       "      <td>S4华南快速</td>\n",
       "      <td>515</td>\n",
       "      <td>113.367322,23.21069;113.367639,23.209913;113.3...</td>\n",
       "      <td>向右前方行驶</td>\n",
       "      <td>进入匝道</td>\n",
       "      <td>S4华南快速</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>沿黄埔立交桥向南行驶236米减速行驶到达收费站</td>\n",
       "      <td>南</td>\n",
       "      <td>236</td>\n",
       "      <td>0</td>\n",
       "      <td>236</td>\n",
       "      <td>黄埔立交桥</td>\n",
       "      <td>80</td>\n",
       "      <td>113.351701,23.127635;113.351654,23.127582;113....</td>\n",
       "      <td>减速行驶</td>\n",
       "      <td>到达收费站</td>\n",
       "      <td>黄埔立交桥</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>沿黄埔立交桥途径黄埔大道西向西行驶104米右转</td>\n",
       "      <td>西</td>\n",
       "      <td>104</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>19</td>\n",
       "      <td>113.351337,23.125625;113.35105,23.125386;113.3...</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>黄埔立交桥</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>向北行驶29米右转</td>\n",
       "      <td>北</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>14</td>\n",
       "      <td>113.350425,23.125521;113.350482,23.125786</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>沿真如东路向北行驶717米左转</td>\n",
       "      <td>北</td>\n",
       "      <td>717</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>149</td>\n",
       "      <td>113.350482,23.125786;113.350981,23.125764;113....</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>真如东路</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>沿明湖南路向西行驶38米到达目的地</td>\n",
       "      <td>西</td>\n",
       "      <td>38</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>8</td>\n",
       "      <td>113.351354,23.13148;113.351016,23.13145;113.35...</td>\n",
       "      <td>[]</td>\n",
       "      <td>到达目的地</td>\n",
       "      <td>明湖南路</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          instruction orientation distance  \\\n",
       "0                                      向北行驶122米向左前方行驶           北      122   \n",
       "1                                   沿博学路向北行驶79米向左前方行驶           北       79   \n",
       "2                                     沿博学路向西北行驶118米左转          西北      118   \n",
       "3                                      沿博学路向西行驶163米右转           西      163   \n",
       "4                                       沿博学路向西行驶33米右转           西       33   \n",
       "5                                    沿中山路向西北行驶1.3千米右转          西北     1265   \n",
       "6                                  沿温泉大道向东北行驶605米左转调头          东北      605   \n",
       "7                            沿温泉大道向西南行驶916米向右前方行驶进入匝道          西南      916   \n",
       "8                        沿G45大广高速入口向西南行驶836米减速行驶到达收费站          西南      836   \n",
       "9                                 沿G45大广高速入口向南行驶49米靠左           南       49   \n",
       "10                沿G45大广高速入口途径G45大广高速向西南行驶1.7千米直行进入隧道          西南     1741   \n",
       "11           沿牛步迳隧道途径温泉流溪河特大桥、G45大广高速向西南行驶8.6千米直行进入隧道          西南     8576   \n",
       "12                     沿明珠隧道途径G45大广高速向西南行驶7.8千米直行进入隧道          西南     7814   \n",
       "13         沿耙齿影隧道途径G45大广高速、牛心岭大桥向西南行驶15.6千米向右前方行驶进入匝道          西南    15624   \n",
       "14                               沿G45大广高速出口向西行驶485米靠左           西      485   \n",
       "15                               沿机场北立交向西行驶535米向右前方行驶           西      535   \n",
       "16                   沿机场北立交途径G4京港澳高速向南行驶20.6千米靠左沿主路行驶           南    20589   \n",
       "17  沿S4华南快速途径梅窿2号大桥、石湖中桥、梅窿1号大桥、长坤1号桥、金垄大桥向南行驶6.1千...           南     6053   \n",
       "18                    沿石门堂山隧道途径S4华南快速向南行驶2.5千米靠左沿主路行驶           南     2504   \n",
       "19                        沿S4华南快速向南行驶10.1千米向右前方行驶进入匝道           南    10105   \n",
       "20                            沿黄埔立交桥向南行驶236米减速行驶到达收费站           南      236   \n",
       "21                            沿黄埔立交桥途径黄埔大道西向西行驶104米右转           西      104   \n",
       "22                                          向北行驶29米右转           北       29   \n",
       "23                                    沿真如东路向北行驶717米左转           北      717   \n",
       "24                                  沿明湖南路向西行驶38米到达目的地           西       38   \n",
       "\n",
       "   tolls toll_distance  toll_road duration  \\\n",
       "0      0             0         []       28   \n",
       "1      0             0         []       24   \n",
       "2      0             0         []       29   \n",
       "3      0             0         []       35   \n",
       "4      0             0         []       11   \n",
       "5      0             0         []      197   \n",
       "6      0             0         []       79   \n",
       "7      0             0         []       62   \n",
       "8      0             0         []       89   \n",
       "9      0            49  G45大广高速入口        2   \n",
       "10     0          1741  G45大广高速入口       83   \n",
       "11     0          8576      牛步迳隧道      328   \n",
       "12     0          7814       明珠隧道      297   \n",
       "13     0         15624      耙齿影隧道      646   \n",
       "14     0           485  G45大广高速出口       18   \n",
       "15     0           535      机场北立交       34   \n",
       "16     0         20589      机场北立交      848   \n",
       "17     0          6053     S4华南快速      294   \n",
       "18     0          2504     石门堂山隧道      121   \n",
       "19     0         10105     S4华南快速      515   \n",
       "20     0           236      黄埔立交桥       80   \n",
       "21     0             0         []       19   \n",
       "22     0             0         []       14   \n",
       "23     0             0         []      149   \n",
       "24     0             0         []        8   \n",
       "\n",
       "                                             polyline  action  \\\n",
       "0   113.679596,23.632574;113.679596,23.632856;113....  向左前方行驶   \n",
       "1   113.679648,23.633689;113.679549,23.633967;113....  向左前方行驶   \n",
       "2   113.679375,23.634358;113.679249,23.634479;113....      左转   \n",
       "3   113.678555,23.635109;113.677856,23.635087;113....      右转   \n",
       "4   113.677083,23.634661;113.677027,23.634701;113....      右转   \n",
       "5   113.676788,23.634657;113.675265,23.636128;113....      右转   \n",
       "6   113.671428,23.644045;113.671636,23.644162;113....    左转调头   \n",
       "7   113.676367,23.647088;113.675964,23.646745;113....  向右前方行驶   \n",
       "8   113.668776,23.642674;113.668546,23.642578;113....    减速行驶   \n",
       "9           113.666063,23.637999;113.666033,23.637548      靠左   \n",
       "10  113.666033,23.637548;113.666046,23.637448;113....      直行   \n",
       "11  113.656667,23.6251;113.656471,23.624657;113.65...      直行   \n",
       "12  113.589965,23.583819;113.589345,23.583633;113....      直行   \n",
       "13  113.541775,23.5374;113.541345,23.536298;113.54...  向右前方行驶   \n",
       "14  113.438164,23.444544;113.438056,23.444631;113....      靠左   \n",
       "15  113.433542,23.445443;113.431901,23.445846;113....  向右前方行驶   \n",
       "16  113.42852,23.446866;113.428181,23.447053;113.4...      靠左   \n",
       "17  113.368116,23.282135;113.367986,23.280026;113....      直行   \n",
       "18  113.358932,23.231901;113.359084,23.231458;113....      靠左   \n",
       "19  113.367322,23.21069;113.367639,23.209913;113.3...  向右前方行驶   \n",
       "20  113.351701,23.127635;113.351654,23.127582;113....    减速行驶   \n",
       "21  113.351337,23.125625;113.35105,23.125386;113.3...      右转   \n",
       "22          113.350425,23.125521;113.350482,23.125786      右转   \n",
       "23  113.350482,23.125786;113.350981,23.125764;113....      左转   \n",
       "24  113.351354,23.13148;113.351016,23.13145;113.35...      []   \n",
       "\n",
       "   assistant_action       road  \n",
       "0                []        NaN  \n",
       "1                []        博学路  \n",
       "2                []        博学路  \n",
       "3                []        博学路  \n",
       "4                []        博学路  \n",
       "5                []        中山路  \n",
       "6                []       温泉大道  \n",
       "7              进入匝道       温泉大道  \n",
       "8             到达收费站  G45大广高速入口  \n",
       "9                []  G45大广高速入口  \n",
       "10             进入隧道  G45大广高速入口  \n",
       "11             进入隧道      牛步迳隧道  \n",
       "12             进入隧道       明珠隧道  \n",
       "13             进入匝道      耙齿影隧道  \n",
       "14               []  G45大广高速出口  \n",
       "15               []      机场北立交  \n",
       "16            沿主路行驶      机场北立交  \n",
       "17             进入隧道     S4华南快速  \n",
       "18            沿主路行驶     石门堂山隧道  \n",
       "19             进入匝道     S4华南快速  \n",
       "20            到达收费站      黄埔立交桥  \n",
       "21               []      黄埔立交桥  \n",
       "22               []        NaN  \n",
       "23               []       真如东路  \n",
       "24            到达目的地       明湖南路  "
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.driving(he_key,driving_origin,driving_destination,driving_province,driving_number)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "246.396px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
